package com.example.demo.controller;
 
import org.springframework.stereotype.Controller;
 
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
import com.google.gson.Gson;
 
@RestController
public class IndexController {
 
	@RequestMapping("/hello")
	@ResponseBody
	public int[] hello(ModelMap model) {
		
		model.addAttribute("name","lao  tou ");
		int [] array=new int[3];
		array[0]=1;
		array[1]=2;
//		Gson gson = new Gson();
//		String jsonObject = gson.toJson(array);
		return array;
	}
	@RequestMapping("/index")
	@ResponseBody
	public String index(ModelMap model) {
		String str = "这个是我的第一个springboot程序";
		return str;
	}
}
